/*
 * Copyright (C) 2007-2008  Hylke van der Schaaf
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, in version 3 of the License.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package hextd.message;

import hextd.message.MessageFactory.NetworkMessage;
import java.util.regex.Pattern;

public class MessagePing implements Message {

	public NetworkMessage type = NetworkMessage.Ping;
	public static String RegExp = "^PING";
	public static Pattern MessagePattern = Pattern.compile(MessagePing.RegExp);
	//
	private String message;

	public static String formatMessage() {
		return "PING";
	}

	public MessagePing() {
	}

	private MessagePing(String message) {
		this.message = message;
	}


	@Override
	public String getMessage() {
		return message;
	}

	@Override
	public Message initFromString(String message) {
		return new MessagePing(message);
	}

	@Override
	public int getSenderId() {
		return 0;
	}

	@Override
	public void setSenderId(int id) {
	}

	@Override
	public Pattern getPattern() {
		return MessagePing.MessagePattern;
	}

	@Override
	public NetworkMessage getType() {
		return type;
	}
}
